<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="p" uri="http://www.shtlls.ltd/tag"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>咖啡书城</title>
<link rel="stylesheet" href="${pageContext.request.contextPath}/admin/bootstrap-4.4.1-dist/css/bootstrap.min.css">
<link rel="stylesheet" href="${pageContext.request.contextPath }/client/css/main.css" type="text/css" />
	<script>
		function validate() {
			if(form['password1'].value == ''){
				alert("密码不能为空!");
				form['password1'].focus();
				return false;
			}
			if(form['password1'].value != form['password2'].value){
				alert("两次输入密码不一致");
				form['password2'].focus();
				form['password2'].select();
				return false;
			}
			if(form.password1.value.length < 6){
				alert("密码设置至少6位");
				form['password1'].focus();
				return false;
			}
		}
	</script>
</head>
<body class="main">
	<p:user />
	<jsp:include page="head.jsp" />
	<jsp:include page="menu_search.jsp" />
	<div id="divpagecontent">
		<table width="100%" border="0" cellspacing="0">
			<tr>
				<td width="25%">
					<table width="100%" border="0" cellspacing="0"
						style="margin-top:30px">
						<tr>
							<td class="listtitle">我的帐户</td>
						</tr>
						<tr>
							<td class="listtd">
								<img src="${pageContext.request.contextPath }/client/images/icon1.png" width="20" height="20" />&nbsp;&nbsp;&nbsp;&nbsp;
								<a href="${pageContext.request.contextPath }/client/modifyuserinfo.jsp">用户信息修改</a>
							</td>
						</tr>
						<tr>
							<td class="listtd">
								<img src="${pageContext.request.contextPath }/client/images/icon2.png" width="20" height="20" />&nbsp;&nbsp;&nbsp;&nbsp;
								<a href="${pageContext.request.contextPath}/findOrderByUser">订单查询</a>
							</td>
						</tr>
						<tr>
							<td class="listtd">
								<img src="${pageContext.request.contextPath }/client/images/icon3.png" width="20" height="20" />&nbsp;&nbsp;&nbsp;&nbsp;
								<a href="${pageContext.request.contextPath}/logout">用戶退出</a>
							</td>
						</tr>
					</table>
				</td>
				<td>
					<div style="text-align:right; margin:5px 10px 5px 0px">
						<a href="${pageContext.request.contextPath }/index.jsp">首页</a>
						&nbsp;&nbsp;&nbsp;&nbsp;&gt;&nbsp;&nbsp;&nbsp;
						<a href="${pageContext.request.contextPath }/client/myAccount.jsp">&nbsp;我的帐户</a>
						&nbsp;&nbsp;&nbsp;&nbsp;&gt;&nbsp;&nbsp;&nbsp;&nbsp;用户信息修改
					</div>
					<table cellspacing="0" class="infocontent">
						<tr>
							<td>
								<form id="form" onsubmit="return validate()" style="margin-left: 20%;margin-top: 2%" action="${pageContext.request.contextPath}/ChangeInfoServlet" method="post">
									<p>会员邮箱：&nbsp;&nbsp;&nbsp;${user.email }</p>
									<p>会员名称：&nbsp;&nbsp;&nbsp;${user.username }</p>
									<p>修改密码：<input id="password1" type="password" name="password1" /><font color="#999999">密码设置至少6位，请区分大小写</font></p>
									<p>重复密码：<input id="password2" type="password" name="password2" /></p>
									<p>性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别：&nbsp;&nbsp;<input type="radio" name="radiobutton" value="男" ${user.gender=='男'?'checked':'' }/> 男
										&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
										<input type="radio" name="radiobutton" value="女"  ${user.gender=='女'?'checked':'' }/> 女</p>
									<p>联系方式：<input type="text" name="phone" value="${user.telephone}" class="textinput" /></p>
									<input style="margin-left: 18%" type="submit" class="btn btn-primary" value="提交">
								</form>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</div>
	<jsp:include page="foot.jsp" />
</body>
</html>
